package com.meilingcloud.activiti.service;

import com.github.pagehelper.Page;
import com.meilingcloud.activiti.domain.dto.DefinitionIdDto;
import com.meilingcloud.activiti.domain.dto.ProcessDefinitionDto;
import com.meilingcloud.common.core.page.PageDomain;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public interface IProcessDefinitionService {

    /**
     * 获取流程定义列表
     */
    Page<ProcessDefinitionDto> selectProcessDefinitionList(ProcessDefinitionDto processDefinition, PageDomain pageDomain);

    DefinitionIdDto getDefinitionsByInstanceId(String instanceId);

    /**
     * 删除流程定义
     */
    int deleteProcessDefinitionById(String id);

    /**
     * 上传并部署流程定义
     */
    void uploadStreamAndDeployment(MultipartFile file) throws IOException;

    /**
     * 启动/挂起流程定义
     *
     * @param id           流程定义id
     * @param suspendState 流程状态
     */
    void suspendOrActiveApply(String id, Integer suspendState);

    /**
     * 上传流程定义
     */
    String upload(MultipartFile file) throws IOException;

    /**
     * 通过bpmn添加流程定义
     */
    void addDeploymentByBpmn(String bpmnStr);

    /**
     * 获取流程定义XML
     */
    void getProcessDefineXML(HttpServletResponse response, String deploymentId, String resourceName) throws IOException;

}
